<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script type="text/javascript" src="js/jquery.min.js"></script>
  <script type="text/javascript" src="js/bootstrap.min.js"></script>
  <script type="text/javascript" src="js/register.js"></script>
  <link rel="stylesheet" href="css/register.css">
  <link rel="stylesheet" href="css/bootstrap.min.css">
  <script type="text/javascript" src="js/Cookie.js"></script>
  <script>
        function zhuan(){
          location.href='${pageContext.request.contextPath}/login.jsp'
        }
        function check(){
          var reEml=/^[\w\-\.]+@[a-z0-9]+(\-[a-z0-9]+)?(\.[a-z0-9]+(\-[a-z0-9]+)?)*\.[a-z]{2,4}$/i
          var username=$('#username').val()
          var account=$('#account').val()
         if (username!=""){
           var isOk=reEml.test(username)
            if (!isOk){
              $('#emailHelp').text("请输入正确的邮箱格式@qq.com")
              return false;
            }else {
              $('#emailHelp').text("")

            }
         } else {
          $('#emailHelp').text("请输入邮箱")
           return false;
         }

         var reg=/^[\u0391-\uFFE5]+$/

          if (account.length>=2&&account.length<=6){
            if (reg.test(account)){
              $('#emailHelp2').text("")
            }else {
              $('#emailHelp2').text("必须输入中文")
              return false;
            }
          }else {
            $('#emailHelp2').text("名称长度必须大于2或者小于6个字")
            return false;
          }

         var ps= $('#password').val();
          if (ps.length>=4){
            $('#emailHelp3').text("")
          }else {
            $('#emailHelp3').text("密码必须设置4位数以上的密码")
            return false;

          }

         var ht= $('#exampleCheck1').prop("checked");
          if (ht){
            return true;
          }else {
            if (confirm("必须勾选我已阅读才能进行注册，是否系统自动帮您勾选")){
              $('#exampleCheck1').prop("checked",true)
            }
            return false;
          }
        }
  </script>
</head>
<body>
<div class="maxi">
  <div class="li">
    <ul>
      <li><img src="img/logo.gif" alt=""></li>
      <li>${requestScope.sert}</li>
      <li>
        <img src="img/wei.png" alt="">
        <img src="img/QQ图片20211211183354.png" alt="">
        <img src="img/QQ图片20211211183417.png" alt="">
      </li>
    </ul>
  </div>

  <!-- 中间部分 -->
  <div class="zhog">
    <!-- 用户登录 -->
    <div class="deng">
      <ul>


        <c:if test="${requestScope.user_name=='用户已存在'}">
          <li>${requestScope.user_name}</li>
        </c:if>
        <c:if test="${requestScope.user_name!='用户已存在'}">
          <li>手机注册</li>
        </c:if>
        <li onclick="zhuan()">已有账号! 登录></li>
      </ul>
      <form action="${pageContext.request.contextPath}/addUserListServlet" method="post" style="padding: 10px" onsubmit="return check()">
        <div class="form-group">
          <label for="username">请输入邮箱</label>
          <input type="text" class="form-control" id="username" name="username" aria-describedby="emailHelp">
          <small id="emailHelp" class="form-text text-danger"></small>
        </div>
        <div class="form-group">
          <label for="account">请输入名称</label>
          <input type="text" class="form-control" id="account" name="account" aria-describedby="emailHelp">
          <small id="emailHelp2" class="form-text text-danger"></small>
        </div>
        <div class="form-group">
          <label for="password">请输入密码</label>
          <input type="password" class="form-control" id="password" name="password">
          <small id="emailHelp3" class="form-text text-danger"></small>
        </div>
        <div class="form-group form-check">
          <input type="checkbox" class="form-check-input" id="exampleCheck1">
          <label class="form-check-label" for="exampleCheck1" style="font-size: 10px"><span>我已阅读并接受《<span style="color: #0099ff;">回头鱼用户协议</span>》《<span style="color: #0099ff;">隐私政策</span>》</span></label>
        </div>
        <button type="submit"  class="btn btn-primary">立即注册</button>
      </form>



    </div>
  </div>
  <!-- 尾部 -->
  <div class="yang">
    <ul>
      <li>网站简介</li>
      <li>联系我们</li>
      <li>招商合作</li>
      <li>用户协议</li>
      <li>隐私政策</li>
      <li>投诉建议</li>
    </ul>

    <p><span>Copyright 2012 - 2021 www.huitouyu.com. All rights reserved. 回头鱼商城版权所有</span></p>

    <div class="pao">
      <div class="pei"><img src="img/yin.png" alt=""></div>
      <div class="pei11"><img src="img/zhi.png" alt=""></div>
      <div class="pei11"><img src="img/wang.png" alt=""></div>
      <div class="pei11"><img src="img/zhong.png" alt=""></div>
      <div class="pei11"><img src="img/360.png" alt=""></div>
    </div>
  </div>
  <!-- 固定位置 -->
  <div class="customer ">
    <img src="img/logos.png" alt="">
    <span>在线客服</span>
  </div>
</div>
</body>
</html>
